Home Reference Source Test
public class | source

BGMapWrapper

This class represents a background map wrapper. Used to be a "middle-man" between the background map provider and the Gisplay API.

See:

Constructor Summary

Public Constructor
public

Creates an instance of BGMapWrapper.

Member Summary

Public Members
public

This is the background map object that comes from the background map provider(e.g., MapBox).

public

loaderDiv: HTMLDivElement

The div that contains the loader.

Method Summary

Public Methods
public

Add click event.

public

addEventListener(eventstr: string, eventfunction: Function): void

Adds a listener to a specified event type.

public

Add Pan/Drag event.

public

Add zoom event.

public

createCanvas(id: number): HTMLElement

Given one id it creates a canvas object.

public

createLoader(): void

Auxiliar method to be called when there is no loader and we want to create one.

public

Returns the background map object.

public

Returns the latitude of the bounding box northwest corner.

public

Returns the longitude of the bounding box northwest corner.

public

getContainer(): HTMLElement

Returns the map's containing HTML element.

public

Returns the height of the canvas element.

public

Returns the width of the canvas elment.

public

Returns the map's current zoom level.

public

showLoader(): void

Shows loader at the beginning when the API is loading the data.

Public Constructors

public constructor(bgmap: Object) source

Creates an instance of BGMapWrapper.

Params:

NameTypeAttributeDescription
bgmap Object

The background map object that came from the provider (e.g., Mapbox, Google Maps).

Public Members

public bgMapObject: Object source

This is the background map object that comes from the background map provider(e.g., MapBox).

public loaderDiv: HTMLDivElement source

The div that contains the loader.

Public Methods

public addClickEvent(map: Map) source

Add click event.

Params:

NameTypeAttributeDescription
map Map

The function to be called when the user clicks on the map.

public addEventListener(eventstr: string, eventfunction: Function): void source

Adds a listener to a specified event type.

Params:

NameTypeAttributeDescription
eventstr string

The event type to add a listen for.

eventfunction Function

The function to be called when the event is fired. The listener function is called with the data object passed to fire , extended with target and type properties.

Return:

void

public addPanEvent(fun: Function) source

Add Pan/Drag event.

Params:

NameTypeAttributeDescription
fun Function

The function to be called when the user performs drag on the map.

public addZoomEvent(fun: Function) source

Add zoom event.

Params:

NameTypeAttributeDescription
fun Function

The function to be called when the user performs zoom in/out on the map.

public createCanvas(id: number): HTMLElement source

Given one id it creates a canvas object.

Params:

NameTypeAttributeDescription
id number

The id of the canvas to be created.

Return:

HTMLElement

Canvas object where everything will be drawn.

TODO:

  • Understand case mapbox comment bellow.

public createLoader(): void source

Auxiliar method to be called when there is no loader and we want to create one.

Return:

void

public getBackgroundMapProviderObject(): bgMapObject source

Returns the background map object. This is the Background provider object (e.g., Mapbox, GMaps, HereMaps, Bing Maps).

Return:

bgMapObject

the background map object.

public getCenterLat(): number source

Returns the latitude of the bounding box northwest corner.

Return:

number

Latitude of northwest corner, measured in degrees.

public getCenterLng(): number source

Returns the longitude of the bounding box northwest corner.

Return:

number

Longitude of northwest corner, measured in degrees.

public getContainer(): HTMLElement source

Returns the map's containing HTML element.

Return:

HTMLElement

The map's HTML element container.

public getHeight(): number source

Returns the height of the canvas element.

Return:

number

the height of the canvas elment.

public getWidth(): number source

Returns the width of the canvas elment.

Return:

number

the width of the canvas elment.

public getZoom(): number source

Returns the map's current zoom level.

Return:

number

The map's current zoom level.

public showLoader(): void source

Shows loader at the beginning when the API is loading the data.

Return:

void

See: